package handlers

import (
	"context"
	"github.com/gin-gonic/gin"
	"log"
	"os/exec"
)

func RunShapeE(c *gin.Context) {
	//cmd := exec.Command("python", "run.py", "test\\automan.jpg", "--output", "output\\automan", "--render")
	//cmd.Dir = "E:\\Project\\TripoSR"
	//
	//err := cmd.Run()
	//if err != nil {
	//	log.Fatal(err)
	//}

	// 创建一个新的上下文
	ctx := context.Background()

	// 创建一个新的命令来运行 'conda' 命令
	cmd := exec.CommandContext(ctx, "E:\\ProgramData\\anaconda3\\envs\\shapeETorch3D\\python.exe", "run.py", "E:\\Project\\TripoSR\\test\\automan.jpg", "--output", "E:\\Project\\TripoSR\\output\\automan", "--render")
	cmd.Dir = "E:\\Project\\TripoSR"

	err := cmd.Run()
	if err != nil {
		log.Fatal(err)
	}
}
